﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="usershopinginfo_parameter.aspx.cs" Inherits="YXShop.Web.admin.templates.label.usershopinginfo_parameter" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link href="../../style/admin.css" rel="stylesheet" type="text/css" />
<script language="javascript" type="text/javascript">
function ReturnValue()
{
    var TempletLayout;      
    var o=document.getElementsByName("Rbl_TempletLayout");//布局方式
    var len=o.length;   
    for (var i=0;i<len ;i++ )       
    {
        if( o[i].checked==true )
        {
            TempletLayout=o[i].value;
        }
    }
    //自定义内容
    var mystyle = document.getElementById("txtLabelContent").value;
    var cnm ="[YX:Loop,YX:LableType=ShoppingInfo,YX:TempletLayout="+TempletLayout+"]"+mystyle+"[/YX:Loop]";

    parent.getValue(cnm);
    CloseDiv();
}
function CloseDiv()
{
    parent.document.getElementById("LabelDivid").style.display="none";
}



 function getValue(value)
    {
        var textObj=document.getElementById("txtLabelContent");
        var textFeildValue=value;
        if(value!="") 
        {
            if(document.all)
            {     
                if(textObj.createTextRange && textObj.caretPos)
                {   
                    var caretPos=textObj.caretPos;   
                    caretPos.text=caretPos.text.charAt(caretPos.text.length-1)==''?textFeildValue+'':textFeildValue;   
                }
                else
                {   
                    textObj.value=textFeildValue;   
                }   
            }
            else
            {   
                if(textObj.setSelectionRange)
                {   
                    var rangeStart =textObj.selectionStart;   
                    var rangeEnd=textObj.selectionEnd;   
                    var tempStr1=textObj.value.substring(0,rangeStart);   
                    var tempStr2 =textObj.value.substring(rangeEnd);   
                    textObj.value=tempStr1+textFeildValue+tempStr2;   
                }
                else
                {   
                    alert("This version of Mozilla based browser does not support setSelectionRange");   
                }   
            }
        }
    }
    function setCaret(textObj)
    {   
        if(textObj.createTextRange)
        {   
            textObj.caretPos=document.selection.createRange().duplicate();   
        }   
    } 

</script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <table cellpadding="1" cellspacing="1"  style="width: 99%; margin-top:5px" class="form_table_input">
           <tr>
                <td>
                    显示信息 </td>
                <td>
                  <asp:DropDownList ID="dd_Condtion" runat="server" Height="25px" Width="151px" 
                        onchange="javascript:getValue(this.value);">
                        <asp:ListItem Value="">--请选择显示信息--</asp:ListItem>
                        <asp:ListItem Value="[#ConsigneeInfo]">收货人信息</asp:ListItem>
                        <asp:ListItem Value="[#OnLinePaymentInfo]">在线支付信息</asp:ListItem>
                        <asp:ListItem Value="[#BankPaymentInfo]">银行支付信息</asp:ListItem>
                        <asp:ListItem Value="[#EscortInfo]">陪送信息</asp:ListItem>
                        <asp:ListItem Value="[#Pro_TotalPrice]">商品总价格</asp:ListItem>
                        <asp:ListItem Value="[#Pro_TotalProductCount]">商品总数量</asp:ListItem>
                        <asp:ListItem Value="[#Pro_TotalWeight]">商品总重量</asp:ListItem>
                        <asp:ListItem Value="[#Pro_TotalInter]">商品总积分</asp:ListItem>
                        <asp:ListItem Value="[#Pro_TotalCost]">费用总计</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    布局方式</td>
                <td>
                    <asp:RadioButtonList ID="Rbl_TempletLayout" runat="server" Height="26px" 
                        RepeatDirection="Horizontal" Width="116px">
                        <asp:ListItem Value="0" Selected="True">Div</asp:ListItem>
                        <asp:ListItem Value="1">Table</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
        <tr>
            <td colspan="4"  align="left">
                    <asp:TextBox runat="server" ID="txtLabelContent" height="200" onselect="setCaret(this);"  onclick="setCaret(this);"  onkeyup="setCaret(this);" Width="500" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
        </table>
    </div>
    </form>
    <table style="width: 100%;" class="form_table_input">
        <tr><td style="width: 100%;" align="center"><input type="button" id="bt_back" value="提交" onclick="ReturnValue()" />
            
        </td></tr>
    </table>
    </div>
    </form>
</body>
</html>